<!DOCTYPE html>
<html ng-app="dataSourceConfigApp" xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <link rel="stylesheet" th:href="@{/assets/select-mutiple/css/select-multiple.css}"/>
    <header th:replace="importCommon"></header>
    <header th:replace="importDate"></header>
    <script th:src="@{/js/system/controller/data-source-config-ctrl.js}"></script>
    <script th:src="@{/js/system/service/data-source-config-service.js}"></script>
    <title>数据源配置</title>
</head>
<body ng-controller="dataSourceConfigCtrl">
<div id="container"></div>
<div class="page-content">
    <div class="commonManager">
        <form id="form1" name="form1" method="post" action="">
            <div class="Manager_style add_info search_style">
                <ul class="search_content clearfix">
                    <li><label class="lf">帐号</label>
                        <label>
                            <input name="name" ng-model="queryFilter.param.name" type="text"
                                   class="text_add"/>
                        </label>
                    </li>
                    <li>
                        <label class="lf">类型</label>
                        <label class="label_text">
                            <select name="type" size="1" ng-model="queryFilter.param.type"
                                    ng-init="queryFilter.param.type='MySQL'">
                                <option ng-repeat="map in typeMap"
                                        ng-selected="map.type == queryFilter.param.type"
                                        value="{{map.type}}" ng-bind="map.name"></option>
                            </select>
                        </label>
                    </li>
                </ul>
                <ul class="search_content clearfix">
                    <button id="btn_search" ng-click="dataSourceConfigSearch = !dataSourceConfigSearch"
                            type="button"
                            class="btn btn-primary queryBtn">查询
                    </button>
                    <button class="btn btn-primary addBtn" type="button" ng-click="add(0)"
                            id="Add_user_btn" shiro:hasPermission="/user/add">添加
                    </button>
                    <button type="button" class="btn btn-primary updateBtn" ng-click="add(1)"
                            shiro:hasPermission="/user/edit">修改
                    </button>
                    <button type="button" class="btn btn-primary deleteBtn" ng-click="delete()"
                            shiro:hasPermission="/user/delete">删除
                    </button>
                </ul>
            </div>
        </form>
        <div class="commonManager">
            <div class="data-list">
                <table id="data_list" cellpadding="0" cellspacing="0"
                       class="table table-striped table-bordered table-hover">
                    <thead>
                    <tr>
                        <th th:width="50">
                            <input name="dataCheckboxAll" id="data_checkbox_all" type="checkbox"
                                   ng-click="selectAll($event)" class="ace"/>
                            <span class="lbl" style="cursor:pointer;"></span>
                        </th>
                        <th>名称</th>
                        <th>类型</th>
                        <th>域名或IP</th>
                        <th>端口</th>
                        <th>数据库</th>
                        <th>用户名</th>
                        <th>密码</th>
                        <th>创建日期</th>
                        <th>状态</th>
                        <th>描述</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr ng-repeat="record in data">
                        <td class="text-center" >
                            <input name="dataCheckbox{{$index}}" value="{{record.code}}" type="checkbox"
                                   class="ace data-checkbox"/>
                            <span class="lbl" style="cursor:pointer;"></span>
                        </td>
                        <td class="text-center" ng-bind="record.name"></td>
                        <td ng-bind="record.type"></td>
                        <td ng-bind="record.host"></td>
                        <td ng-bind="record.port"></td>
                        <td ng-bind="record.dbName"></td>
                        <td ng-bind="record.username"></td>
                        <td ng-bind="record.password"></td>
                        <td ng-bind="record.createAt | date:'yyyy-MM-dd HH:mm:ss'"></td>
                        <td ng-bind="record.status"></td>
                        <td ng-bind="record.description"></td>
                    </tr>
                    </tbody>
                </table>
            </div>
            <div class="hupan_more eg-page" ng-init="" url="/dataSourceConfig/list" request-page-params="queryFilter"
                 click-search="dataSourceConfigSearch" return-page-rows="data"></div>
        </div>

        <form name="form">
            <div id="edit_panel" style="display: none">
                <div class="commonManager ">
                    <div class="addCommon">
                        <ul class="clearfix">
                            <li>
                                <label class="label_name">名称</label>
                                <label>
                                    <input name="name" ng-model="record.name" type="text" value=""
                                           class="text_add" ht-validate="{required:true}"/>
                                </label>
                            </li>
                            <li>
                                <label class="label_name">类型</label>
                                <label>
                                    <select name="type" size="1" ng-model="record.type"
                                            ng-init="record.type='MySQL'">
                                        <option ng-repeat="map in typeMap"
                                                ng-selected="map.type == record.type"
                                                value="{{map.type}}" ng-bind="map.name"></option>
                                    </select>
                                </label>
                                <i style="color: #F60;">*</i>
                            </li>
                        </ul>
                        <ul class="clearfix">
                            <li>
                                <label class="label_name">域名或IP</label>
                                <label>
                                    <input name="host" ng-model="record.host" type="text" value=""
                                           class="text_add" ht-validate="{required:true}"/>
                                </label>
                            </li>
                            <li>
                                <label class="label_name">端口</label>
                                <label>
                                    <input name="port" ng-model="record.port" type="text" value=""
                                           class="text_add" ht-validate="{required:true}"/>
                                </label>
                            </li>
                            <li>
                                <label class="label_name">数据库</label>
                                <label>
                                    <input name="dbName" ng-model="record.dbName" type="text" value=""
                                           class="text_add" ht-validate="{required:true}"/>
                                </label>
                            </li>
                        </ul>
                        <ul class="clearfix">
                            <li>
                                <label class="label_name">用户名</label>
                                <label>
                                    <input name="username" ng-model="record.username" type="text" value=""
                                           class="text_add" ht-validate="{required:true}"/>
                                </label>
                            </li>
                            <li>
                                <label class="label_name">密码</label>
                                <label>
                                    <input name="password" ng-model="record.password" type="text" value=""
                                           class="text_add" ht-validate="{required:true}"/>
                                </label>
                            </li>
                        </ul>
                        <ul class="clearfix">
                            <div class="description" style="padding-top: 20px;">
                                <label class="label_name">描述</label>
                                <label>
                                <textarea name="description" ng-model="record.description" cols="" rows=""
                                          style="width: 456px; height: 100px; padding: 5px;"></textarea>
                                </label>
                            </div>
                        </ul>
                    </div>
                </div>
                <!--<div class="layui-layer-btn">
                    <a class="layui-layer-btn0" ht-save="/dataSourceConfig/add" ng-model="dict">保存</a>
                    <a class="layui-layer-btn1">取消</a>
                </div>-->
            </div>
        </form>
    </div>
</div>
</body>
</html>